<template>
  <div>
    <div class="content">
      <div class="demo-image__preview">
        <!-- <el-image v-for="(src, index) in srcList" :key="index" :src="src" fit="fill" :preview-src-list="srcList"></el-image> -->
        <el-image :src="url" fit="cover"></el-image>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props:{
    url:{
      type:String,
      default:""
    }
  },
  data() {
    return {
      srcList: '',
      showImgs: false,
    }
  },
  created() {

  },
  mounted() {
    this.$bus.$on('showImg', (params) => {
      console.log(params)
      this.srcList = params.url;
      this.showImgs = true
    })
    this.$bus.$on('hideImg', () => {
      this.srcList = '';
      this.showImgs = false
    })
  }
}
</script>
